package com.qdlc.p2p.biz.executer;

import java.util.Map;

import com.qdlc.p2p.dal.common.NoticeTypeHelper.NidType;
import com.qdlc.p2p.dal.dto.User;

public abstract class AbstractBusinessExecutor implements BusinessExecutor{

	// 资金
	protected double money;
	
	// 交易对方
	protected User toUser;
	
	
	/**
	 * 发送Notice(短信、邮件、站内信)
	 * @param user 当前登录用户
	 * @param noticeTypeNid notice模版nid
	 * @param nidType notice类型
	 */
	protected void sendNotice(User user, String noticeTypeNid, NidType nidType, Map<String, Object> sendData){
		NoticeExecutor noticeExecutor = new NoticeExecutor(noticeTypeNid, nidType);
		noticeExecutor.addSendData(sendData);
		noticeExecutor.execute(user);
	}
	
	protected void sendNotice(User user, String noticeTypeNid, Map<String, Object> sendData){
		NoticeExecutor noticeExecutor = new NoticeExecutor(noticeTypeNid);
		noticeExecutor.addSendData(sendData);
		noticeExecutor.execute(user);
	}
	
	
	public double getMoney() {
		return money;
	}

	public void setMoney(double money) {
		this.money = money;
	}

	public User getToUser() {
		return toUser;
	}

	public void setToUser(User toUser) {
		this.toUser = toUser;
	}
	
}
